#include<iostream>
#include<ctime>
#include"ThreadPool.hpp"
#include"Task.hpp"
#include<unistd.h>

int main()
{
    std::cout << "process running ..." << std::endl;
    sleep(3);

    ThreadPool<Task>::GetInstance()->Start(); 
    srand(time(nullptr)^getpid()); 

    while(true)
    {
        int x = rand() % 10 + 1;
        usleep(10);
        int y = rand() % 5;
        char op = opers[rand() % opers.size()];

        Task t(x, y, op);
        ThreadPool<Task>::GetInstance()->Push(t);
        
        std::cout << "main thread make task: " << t.GetTask() << std::endl; 
        sleep(1);
    }
    return 0;
}
